<%@ page import="java.util.List" %>
<%@ page import="vo.Student" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css" />
</head>
<script>
function up(id,path) {
//弹出确认框
var flag = confirm("你确定要修改" + id + "号部门吗?");

//如果单击确定，则执行DelDeptServlet，并且传入部门编号
    //删除
if (flag) {

location.href = path+"/DelDepaByIdServlet?id="+id;
}
}
</script>
<body>
<div class="container">
    <div class="row">
        <form class="form-inline" action="${pageContext.request.contextPath}/SelectDepatServlet" style="margin: 10px;">
            <div class="form-group">
                <label>学生姓名</label>
                <input type="text" name="name" class="form-control" />
            </div>
            <div class="form-group">
                <label>班级编号</label>
                <select name="classid" class="dfinput">
                   <%
                       if (request.getAttribute("students")!=null){
                           List<Student> students=(List<Student>)request.getAttribute("students");
                   %>
                    <option value=0>
                                   <--请选择-->
                              </option>
                    <%
                           for (Student student:students){
                    %>
                    <option value="${student.clazzid}">
                                  ${student.clazzid}
                              </option>
                    <%
                           }
                   }

                   %>
                </select>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-info">查询</button>
                <a href="StudentInsert.jsp" class="btn btn-info">添加</a>

            </div>
            <input type="hidden" id="url" value="${pageContext.request.contextPath}" />
        </form>
    </div>
    <div class="row">
        <form action="">
            <table class="table table-bordered table-striped table-hover text-center">
                <tr>
                    <td>
                        <label>全<input type="checkbox" id="all" />选</label>
                    </td>
                    <td><label>学号</label></td>
                    <td><label>姓名</label></td>
                    <td><label>班级编号</label></td>
                    <td><label>操作</label></td>
                </tr>



                 <%
                     if (request.getAttribute("students")!=null){
                         List<Student> students=(List<Student>)request.getAttribute("students");
                     for (Student student:students){
                         %>
                <tr>
                    <td>
                        <input type="checkbox" name="ids" />
                    </td>
                    <td>${student.id}</td>
                    <td>${student.name}</td>
                    <td>${student.clazzid}</td>
                    <td>
                        <a href="StudentUpdate.jsp">修改</a>
                        <a href="javascript:del(${student.id }">删除</a>
                        <a href="ScoresManager.html">成绩管理</a>
                    </td>
                </tr>
                    <%
                     }
                     }

                 %>






            </table>
            <div class="container">
                <div class="row">
                    <div class="col-md-2">
                        <input type="submit" value="批量删除" class="btn btn-danger" />
                    </div>
                    <div class="col-md-4"></div>
                    <div class="col-md-6">
                        共3条记录&nbsp;1页/当前第1页
                        <a href="#">首页</a>
                        <a href="#">上一页</a>
                        <a href="#">下一页</a>
                        <a href="#">尾页</a>
                        跳转到<input type="text" style="width: 30px; margin: 5px 0px;" />页
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
</body>

</html>
